
import 'package:amap_map_fluttify/amap_map_fluttify.dart';
import 'package:flutter/material.dart';

class YBLocationInfoProvider with ChangeNotifier{

 // String recodeStr;

  List<Poi> addressList = List<Poi>();
  
  void getLocationInfo() async {

    final location = await AmapLocation.instance.fetchLocation();
    print('地理位置信息--------${location.latLng}');


    final  reGeoCodeList = await AmapSearch.instance.searchReGeocode(location.latLng,radius: 200.0,);

    print('--------${reGeoCodeList.formatAddress}----');

    // reGeoCodeList.formatAddress.then((value){
    //    recodeStr = value;
    //    notifyListeners();
    // });

    reGeoCodeList.poiList.then((value){
      addressList.addAll(value);
      notifyListeners();
    });


  }


}